package com;

import org.apache.http.Header;
import org.apache.http.message.BasicHeader;

import java.util.Map;

/**
 * @description:
 * @author: sksun2
 * @create: 2023-07-08
 */
public class HeadParam extends BaseParam{

    /**
     * 获取请求头
     * @return
     */
    public Header[] toHeaders() {
        final Map<String, String> headMap = toMap();
        return headMap.entrySet().stream()
                .map(entry -> new BasicHeader(entry.getKey(), entry.getValue()))
                .toArray(Header[]::new);
    }
}
